import { defineStore } from 'pinia'
import { getSystemInfo } from '@/api/modules/system'

export const useSystemStore = defineStore('system', {
  state: () => ({
    systemInfo: null as any,
    loading: false
  }),
  actions: {
    async fetchSystemInfo() {
      this.loading = true
      try {
        const res = await getSystemInfo()
        this.systemInfo = res?.data 
      } finally {
        this.loading = false
      }
    }
  }
})